FrameLib  2.0
DSP processing with frames of arbitrary timing and length
FrameLib_Global Class Reference

a class for containing and managing FrameLib's global resources. More...

#include <FrameLib_Global.h>

Inheritance diagram for FrameLib_Global:
FrameLib_ErrorReporter

Static Public Member Functions

static FrameLib_Globalget (FrameLib_Global **global, FrameLib_ErrorReporter::HostNotifier *notifier=nullptr)
 
static void release (FrameLib_Global **global)
 

Friends

class FrameLib_Context
 

Additional Inherited Members

- Public Member Functions inherited from FrameLib_ErrorReporter
 FrameLib_ErrorReporter (HostNotifier *notifier)
 
template<typename... Args>
void reportError (ErrorSource source, FrameLib_Proxy *reporter, const char *error, Args... args)
 
std::unique_ptr< ErrorListgetErrors ()
 

Detailed Description

a class for containing and managing FrameLib's global resources.

The global object represents a self-contained FremeLib environment with a single memory-management and error reporting system. The host environment needs to maintain at least one global object in order to create FrameLib networks. Global objects are not constructed/deleted directly, but managed via calls to the static get()/release() methods which take a handle and maintain an internal reference count. The global object can be used as a singleton via a globally-accessible handle, or if preferred separate networks may use individual global objects, in which case they share no resources.

The global objects manages memory allocation, error reporting and the resources for scheduling DSP. FrameLib objects do not deal directly with the global object - it is the responsibility of the host to create an manage these objects, and they are identified to FrameLib objects via a FrameLib_Context object.

Member Function Documentation

◆ get()

FrameLib_Global * FrameLib_Global::get ( FrameLib_Global **  global,
FrameLib_ErrorReporter::HostNotifier notifier = nullptr 
)
static

Get a pointer to a FrameLib_Global object

If the handle points to a nullptr, on return it will point to a valid FrameLib_Global object. Otherwise the reference count of the global object will be incremented. If a new global object is created it will use the object pointed to by notifier to report errors to the host.

Parameters
globala handle to a FrameLib_Global object.
notifiera pointer to a class that extends FrameLib_ErrorReporter::HostNotifier.
See also
release()

◆ release()

void FrameLib_Global::release ( FrameLib_Global **  global)
static

Release a FrameLib_Global object

If the handle points a valid FrameLib_Global object then its reference count will be decremented. If the count becomes zero the object will be deleted and the contents of the handle replaced with a nullptr.

Parameters
globala handle to a FrameLib_Global object.
See also
get()

Friends And Related Function Documentation

◆ FrameLib_Context

friend class FrameLib_Context
friend

The documentation for this class was generated from the following files: